Java

About

  • Java in 100s .

  • Java v21 .

  • Forced you into OOP by requiring declarations inside classes, but in v21 you no longer need a class to create functions.

  • New syntax:

void main() {
    System.out.println('hi mom');
}
  • Uses JDK (Java Development Kit) for X.

  • Default access control:  Package-Private.

    • A class, property, or method without an explicit access modifier will have restricted visibility to the package  where it was declared.

Syntax

  • The default access modifier for members (properties, methods, and classes) is package-private , and not private . This means:

    • If you do not specify a visibility modifier in Java :

      • The member will only be accessible within the same package .

      • It will not be accessible outside the package , even if it is in the same class hierarchy.

    • Java default visibility  (package-private):

      • A class, property, or method without an explicit access modifier will have visibility restricted to the package  where it was declared.

  • It is quite "verbose".

  • A simple print is a huge sequence of boilerplate.

class HelloWorld {
    public static void main(String[] args) {
        String hello_mom = 'hello mom';
        System.out.println(hello_mom);
    }
}

JDk

JDK: Temurin
  • Temurin .

  • Open-source version of Oracle JDK.

  • 100% compatible with Java specifications.

  • Essentially has everything the Oracle JDK has.

  • Naturally, this is the version to choose.

  • "If the requirement is TemurinJDK 17, can I use TemurinJDK 23?"

    • "If the requirement is TemurinJDK 17, you should not download TemurinJDK 23 to guarantee compatibility, unless you are sure the system or application is also compatible with newer JDK versions."

JDK: Oracle
  • Obtained from the Java website.

  • Has a commercial license. Requires a paid subscription.````